//@author A0080442N
#pragma once
#ifndef TASKITTIME_H_
#define TASKITTIME_H_

#include "TaskItGlobal.h"
#include <ctime>

//TaskItTime class for TaskIt. TaskItTime class would hold the hour and minutes
//for each TaskItTime created in each Task that is created. It would be able to
//check whether a time is valid to be created or another TaskItTime object is
//later then one another.
class TaskItTime {
private:
	int _hour, _min;
	bool _hasTime;
	string _display;
	string _originalDisplay;
	string _timeStorage;

public:
	TaskItTime();
	
	//Given a string, the function set the into the private attributes _hour,
	//_min.
	//Pre-Req: Takes in a string. Valid inputs should be hhmm.
	//Post-Req: Sets the time if input is valid, else throw an invalid message.
	void setTime(string time);
	//Function will be able to retrieve the computer local time.
	//Pre-Req: None
	//Post-Req: Sets the local time for the program.
	void getLocalTime();

	//Function will check whether the input string is a valid time or not.
	//Pre-Req: Takes in a string. Valid inputs should be hhmm.
	//Post-Req: Returns true if time is valid, else return false.
	bool isValidTime(string time);
	//Function will check whether the first TaskItTime object is later than
	//the input second TaskItTime object.
	//Pre-Req: Takes in a TaskItTime object.
	//Post-Req: Returns true if the first object is later than the second,
	//			else returns false.
	bool isLaterTime(TaskItTime secondTime);
	
	//This is the getter function to get the hour in the time.
	//Pre-Req: None.
	//Post-Req: Return the hour in the time.
	int getHour();
	//This is the getter function to get the min in the time.
	//Pre-Req: None.
	//Post-Req: Return the min in the time.
	int getMin();
	//This is the getter function to get the boolean _hasTime.
	//Pre-Req: None.
	//Post-Req: Return the boolean _hasTime.
	bool getHasTime();
	//This is the getter function to get the string in the form
	//0000 to 2359.
	//Pre-Req: None.
	//Post-Req: Return a string display of time.
	string getTimeStorage();
	//This is the getter function to get the string in the form
	//00:00 to 23:59.
	//Pre-Req: None
	//Post-Req: Return a string display of time.
	string getDisplay();
	//This is the getter function to get the string in the form
	//0000 to 2359.
	//Pre-Req: None.
	//Post-Req: Return a string display of time.
	string getOriginalDisplay();
};

#endif
